package com.appkubes.fintech.admin.application.order.dao;

import com.appkubes.fintech.admin.application.bill.dao.RentBillHeaderSqlProvider;
import com.appkubes.fintech.admin.application.bill.entity.dto.RentBillHeaderDTO;
import com.appkubes.fintech.admin.application.bill.entity.vo.RentBillHeaderRequest;
import com.appkubes.fintech.admin.application.order.entity.dto.RentOrderDTO;
import com.appkubes.fintech.admin.application.order.entity.vo.RentOrderVO;
import com.appkubes.fintech.core.po.FintechRentOrder;
import com.appkubes.fintech.core.pojo.FintechRentOrderMapper;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
@Repository
public interface RentOrderDao extends FintechRentOrderMapper {


    @SelectProvider(type= RentOrderSqlProvider.class, method="select")
    List<RentOrderDTO> queryPage(RentOrderVO vo);

    @Update({"update fintech_rent_order set contract_url = #{contract_url} where rent_order_key=#{orderKey}"})
    int updateOrderContractUrl(@Param("contract_url")String contract_url, @Param("orderKey")String orderKey);

    @Update("UPDATE mall_order SET mall_order.`status` = #{status},mall_order.`update_time`=#{updateTime},mall_order.`confirm_time`=#{confirmTime} WHERE mall_order.`order_key`= #{orderKey}")
    Integer updateMallOrder(@Param("orderKey") String orderKey, @Param("status") String status, @Param("updateTime") int updateTime, @Param("confirmTime") int confirmTime);
}


